### Alizade, Dancygier, Ditlmann
### "National Penalties Reversed"
### Replication Code 
### Table 1
### For questions, contact jalizade@princeton.edu

# setup
rm(list=ls())
setwd("C:/Users/Jey/Dropbox/WZB/NaturalizationExperiment/Submission/JOP/replication_JOP/data")
library(foreign)
dat <- read.dta("data_munic_2000+.dta")

### N ###

# in sample
sum(dat$insample)

# overall
nrow(dat)


### Population ###

# in sample
mean(dat$pop[dat$insample==1], na.rm=T)
sd(dat$pop[dat$insample==1], na.rm=T)

# overall
mean(dat$pop, na.rm=T)
sd(dat$pop, na.rm=T)


### Population Density ###

# in sample
mean(dat$pop_density[dat$insample==1], na.rm=T)
sd(dat$pop_density[dat$insample==1], na.rm=T)

# overall
mean(dat$pop_density, na.rm=T)
sd(dat$pop_density, na.rm=T)


### Foreign Population (%) ###

# in sample
mean(dat$pop_foreign_pct[dat$insample==1], na.rm=T)
sd(dat$pop_foreign_pct[dat$insample==1], na.rm=T)

# overall
mean(dat$pop_foreign_pct, na.rm=T)
sd(dat$pop_foreign_pct, na.rm=T)


### East Germany ###

# in sample
mean(dat$east[dat$insample==1], na.rm=T)*100
sd(dat$east[dat$insample==1], na.rm=T)*100

# overall
mean(dat$east, na.rm=T)*100
sd(dat$east, na.rm=T)*100
